home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / pbmpl91d.zip / PBMPLUS / MAN / PBMMASK.MAN < prev    next >
Text File  |  1993-01-08  |  2KB  |  70 lines

  1.  
  2.  
  3. pbmmask(1)                 Unix Programmer's Manual                 pbmmask(1)
  4.  
  5.  
  6. NAME
  7.      pbmmask - create a mask bitmap from a regular bitmap
  8.  
  9. SYNOPSIS
  10.      pbmmask [-expand] [pbmfile]
  11.                         -------
  12.  
  13. DESCRIPTION
  14.      Reads a portable bitmap as input.  Creates a  corresponding  mask  bitmap
  15.      and writes it out.
  16.  
  17.      The color to be interpreted as "background" is determined  automatically.
  18.      Regardless of which color is background, the mask will be white where the
  19.      background is and black where the figure is.
  20.  
  21.      This lets you do a masked paste like  this,  for  objects  with  a  black
  22.      background:
  23.          pbmmask obj > objmask
  24.          pnmpaste < dest -and objmask <x> <y> | pnmpaste -or obj <x> <y>
  25.      For objects with a white background, you can either invert them or add  a
  26.      step:
  27.          pbmmask obj > objmask
  28.          pnminvert objmask | pnmpaste -and obj 0 0 > blackback
  29.          pnmpaste < dest -and objmask <x> <y> | pnmpaste -or blackback <x> <y>
  30.      Note  that  this  three-step  version  works  for  objects   with   black
  31.      backgrounds too, if you don't care about the wasted time.
  32.  
  33.      You can also use masks with graymaps  and  pixmaps,  using  the  pnmarith
  34.                                                                       --------
  35.      tool.  For instance:
  36.          ppmtopgm obj.ppm | pgmtopbm -threshold | pbmmask > objmask.pbm
  37.          pnmarith -multiply dest.ppm objmask.pbm > t1.ppm
  38.          pnminvert objmask.pbm | pnmarith -multiply obj.ppm - > t2.ppm
  39.          pnmarith -add t1.ppm t2.ppm
  40.      An interesting variation  on  this  is  to  pipe  the  mask  through  the
  41.      pnmsmooth  script  before  using it.  This makes the boundary between the
  42.      ---------
  43.      two images less sharp.
  44.  
  45.      -expand
  46.           Expands the mask by one pixel out from the image.  This is useful if
  47.           you  want  a  little  white  border  around  your  image.  (A better
  48.           solution might be to turn the pbmlife tool into a  general  cellular
  49.                                         -------
  50.           automaton tool...)
  51.  
  52. SEE ALSO
  53.      pnmpaste(1), pnminvert(1), pbm(5), pnmarith(1), pnmsmooth(1)
  54.  
  55. AUTHOR
  56.      Copyright (C) 1988 by Jef Poskanzer.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.                                08 August 1989                                1
  69.  
  70.